package com.jsu.controller;

import com.jsu.service.BarrageService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.example.model.common.dtos.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;

@RestController
@Api(tags = "弹幕信息控制器")
@RequestMapping("/api/barrage")
public class BarrageController {
    @Autowired
    private BarrageService barrageService;

    @GetMapping("/index")
    @ApiOperation(value = "请求测试")
    public ResponseResult index(){
        return ResponseResult.okResult("请求成功！");
    }

    @PostMapping("/addBan")
    @ApiOperation(value = "管理员设置用户禁言")
    public ResponseResult addBan(Integer sid,Integer type,Integer userId){
        return barrageService.addBan(sid,type,userId);
    }
    @DeleteMapping("/cancleBan")
    @ApiOperation(value = "管理员取消用户禁言")
    public ResponseResult cancleBan(Integer sid,Integer type,Integer userId){
        return barrageService.cancleBan(sid,type,userId);
    }
    @GetMapping("/getUserBarrageBan")
    @ApiOperation(value = "查看某用户在某个直播间是否被禁言")
    public ResponseResult getUserLiveBan(Integer sid,Integer type,Integer userId){
        return barrageService.getUserLiveBan(sid,type,userId);
    }
    @GetMapping("/getAllBarrageBan")
    @ApiOperation(value = "查看所有议程活动的禁言情况")
    public ResponseResult getAllLiveBan(){
        return barrageService.getAllLiveBan();
    }
}
